1. Technical Field
This invention relates to managing requests in a computer system. More specifically, the invention relates to ensuring that a thread will be available to process a request prior to initiating execution of the request.
2. Description of the Prior Art
In a distributed computer system with shared persistent storage, one or more server nodes are in communication with one or more client nodes. FIG. 1 is a block diagram (10) illustrating one example of a distributed computer system. As shown, there are two server nodes (12) and (14), three client nodes (16), (18), and (20), and a storage area network (5) that includes one or more storage devices (not shown). Each of the client nodes (16), (18), and (20) may access an object or multiple objects stored on the file data space (27) of the storage area network (5), but may not access the metadata space (25). In opening the contents of an existing file object on the storage media of the storage device in the storage area network (5), a client contacts the server node to obtain metadata and locks. Metadata supplies the client with information about a file, such as its attributes and location on the storage devices. Locks supply the client with privileges it needs to open a file and read or write data. The server node performs a look-up of metadata information for the requested file within the metadata space (25) of the storage area network (5). The server nodes (12) or (14) communicate granted lock information and file metadata to the requesting client node, including the location of the data blocks making up the file. Once the client node holds a distributed lock and knows the data block location(s), the client can access the data for the file directly from a shared storage device attached to the storage area network.
In the distributed computing system of FIG. 1, there are finite quantities of execution threads available for the servers and/or clients in executing requests. A multi-stage request, also known as a nested request, will require a first execution thread to request a second execution thread in order to complete the request. In the nested request, the first execution thread will suspend operation while it waits for a reply from the second execution thread. For example, one of the client nodes may initiate a first request for a lock that will require a response from one of the server nodes. A problem may be encountered when a first thread has been executed by one of the servers for the first request, and one of the other client nodes initiates a second request for service and no second execution thread is available for the second request. This scenario is known as a deadlock. In order to avoid a deadlock scenario the first thread must know that the second thread will be available for execution prior to the first thread committing to the execution of a request.
One prior art solution is to reserve a quantity of threads in a thread pool, wherein the reserved threads are exclusively for use with secondary requests in a nested request. By reserving a quantity of threads for use as secondary requests in a nested request, an operator mitigates a deadlock situation associated with a nested request and encourages availability of threads to complete the nested request. However, there are drawbacks associated with reserving a pool of threads exclusively for secondary requests of a nested request. A quantity of threads in a multithreaded processing system is statically generated. As such, there are a finite number of threads available. One drawback is designating a defined quantity of threads for secondary requests without prior knowledge as to whether a first execution thread is part of a nested request. If the reserved threads are not available for other requests, the availability of threads for all requests is reduced. Accordingly, in a system with a predefined quantity of threads, reserving a set quantity of threads for servicing secondary requests is not an efficient allocation of threads.
Another prior art solution, U.S. patent Publication 2002/0194377 to Doolittle et al., uses multiple pools, i.e. data structures, for holding threads, wherein different pools are reserved for different stages in a nested request. Threads are redistributed among thread pools when a potential exhaustion of a pool is discovered. Accordingly, the quantity of available threads among a plurality of thread pools is dynamically modified in order to honor all service requests.
However, there are limitations associated with what is disclosed in the Doolittle et al. publication. For example, management of threads in the manner taught by Doolittle et al. can be complex and expensive to operate. There is therefore a need for management of threads in a system that supports nested requests that does not require any added expense. In addition, such a solution should make all threads eligible to support any stage in a nested request.